! 13.Mar.2013: DO NOT USE. Copied to numeric_grid.f95
module grid_test; 
use numeric_grid;
use vec_factory;
implicit none;

contains 

logical function grid_test_all() result(ok);  implicit none; 
  call dbg_info("-->grid_test_all()"); 
  ok = .TRUE.
  ok = new_step_grid_test();
  !ok = vec_dot_test_speed();
  return
end function

logical function new_step_grid_test() result(ok);  implicit none; 
  integer :: vsize;
  real(R14) :: minv, maxv;
  real(R14), dimension(:), pointer :: pv;      
  call dbg_info("-->new_step_grid_test()"); 
  ok = .TRUE.
  call dbg_vec_to_save();
  call dbg_vec_all_on();

  vsize = 2;  minv = 0.; maxv = 1.;
  pv => new_step_grid(minv, maxv, vsize);
  call assert_max_zero("2.pv(1)=minv", pv(1) - minv);
  call assert_max_zero("2.pv(vsize)=maxv", pv(vsize) - maxv);
  call del_vec(pv);

  vsize = 3;  minv = -1.; maxv = 1.;
  pv => new_step_grid(minv, maxv, vsize);
  call assert_max_zero("3.pv(1)=minv", pv(1) - minv);
  call assert_max_zero("3.pv(2)=0", pv(2));
  call assert_max_zero("3.pv(vsize)=maxv", pv(vsize) - maxv);
  call del_vec(pv);
  call del_vec(pv);

  call dbg_vec_from_save();
  return
end function

end module 